package cn.iocoder.yudao.module.knowledge.dal.mysql.elecdataln;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.knowledge.dal.dataobject.elecdataln.ElecDataLnDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.knowledge.controller.admin.elecdataln.vo.*;

/**
 * 用电信息查询 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface ElecDataLnMapper extends BaseMapperX<ElecDataLnDO> {

    default PageResult<ElecDataLnDO> selectPage(ElecDataLnPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ElecDataLnDO>()
                .eqIfPresent(ElecDataLnDO::getCity, reqVO.getCity())
                .eqIfPresent(ElecDataLnDO::getConsNo, reqVO.getConsNo())
                .likeIfPresent(ElecDataLnDO::getConsName, reqVO.getConsName())
                .eqIfPresent(ElecDataLnDO::getHylb, reqVO.getHylb())
                .likeIfPresent(ElecDataLnDO::getQygs, reqVO.getQygs())
                .eqIfPresent(ElecDataLnDO::getSchsx, reqVO.getSchsx())
                .eqIfPresent(ElecDataLnDO::getYdlb, reqVO.getYdlb())
                .eqIfPresent(ElecDataLnDO::getDhdy, reqVO.getDhdy())
                .betweenIfPresent(ElecDataLnDO::getTotaldl, reqVO.getTotaldl())
                .orderByDesc(ElecDataLnDO::getTotaldl));
    }

}